home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmiSoft / Dev / src / blobzsrc.lha / blobzsrc / source / Blobz.asc next >
Encoding:
Text File  |  2004-01-24  |  31.0 KB  |  1,163 lines

  1. ; Blobz v1.0
  2. ; (c) Graham Humphrey 2003-2004
  3. ; STARTED: Wed Dec 24 2003 5:19 PM
  4. ; FINISHED: Fri Jan 23 2004 5:03 PM
  5. ;
  6. ;BLOBZ SHAPE FILES
  7. ;=================
  8. ;
  9. ;Contents of 'title.shp':
  10. ;
  11. ;0 = Title Logo
  12. ;1 = Start Game
  13. ;2 = Load Game
  14. ;3 = High Scores
  15. ;4 = Quit
  16. ;5 = Pointer
  17. ;
  18. ;Contents of 'ar.shp':
  19. ;
  20. ;0 = AR Logo
  21. ;1 = Presents
  22. ;
  23. ;Contents of 'world1.shp':
  24. ;
  25. ;0 = Normal
  26. ;1 = Gem
  27. ;2 = Key
  28. ;3 = Extra Life
  29. ;4 = 100 Points
  30. ;5 = Health
  31. ;6 = Start
  32. ;7 = Door (Vertical)
  33. ;8 = Door (Horizontal)
  34. ;9 = Death
  35. ;10-11 = Exit
  36. ;12 = Ice
  37. ;13-16 = Arrows (Right, Up, Left, Down)
  38. ;17-31 = Wall
  39. ;32-47 = Enemies
  40. ;
  41. ;Contents of 'objects.shp':
  42. ;
  43. ;0 = Gem
  44. ;1 = Key
  45. ;2 = Extra Life
  46. ;3 = 100 Points
  47. ;4 = Health
  48. ;5 = Door (Horizontal)
  49. ;6 = Door (Vertical)
  50. ;
  51. ;Contents of 'player.shp' and the 'enemy.shp' files:
  52. ;
  53. ;0 = None
  54. ;1 = Right
  55. ;2 = Up
  56. ;3 = Left
  57. ;4 = Down
  58. ;5 = Up-Left
  59. ;6 = Up-Right
  60. ;7 = Down-Left
  61. ;8 = Down-Right
  62.  
  63. WBStartup
  64. SetErr:End:End SetErr
  65.  
  66. .constants
  67.  
  68. #mapwidth=40             ; set up constants
  69. #mapheight=32
  70. #blockwidth=16
  71. #blockheight=16
  72. #shapeoffset=0
  73. #maxdepth=5
  74. #mapnull=1
  75. #datasize=2
  76. #maxlevels=50
  77. cheat=0
  78. complete=0
  79.  
  80. Dim highname$(9)
  81. Dim highpoints.w(9)
  82.  
  83. For n=0 To 9
  84.   MaxLen highname$(n)=20
  85. Next n
  86.  
  87. .begin
  88.  
  89. level=1:lives=3:health=3:score=0:gems=0:keys=0:done=0:sav=0
  90.  
  91. NEWTYPE .block             ; define newtypes for game elements
  92.     shap.w:x:y
  93. End NEWTYPE
  94.  
  95. NEWTYPE .stuff
  96.     shap.w:x:y:p:typ:sp:ex:ey:l
  97. End NEWTYPE
  98.  
  99. Dim List blk.block(#mapwidth*#mapheight) ; use list array for map tiles
  100. Dim List stf.stuff(#mapwidth*#mapheight)
  101.  
  102. n=0
  103. count=0
  104. db=0
  105. x=120:y=160
  106.  
  107. ;This code generated by the RED Map Editor v2.5, and edited by me
  108. ;Draws the map onto the given bitmap
  109. ;address=address of map file
  110. ;xpos and ypos of coordinates to draw from
  111. ;bitmap is the bitmap to render to
  112.  
  113. Statement DrawMyMap{address.l,xpos.w,ypos.w,bitm.b}
  114.   SHARED blk.block(),stf.stuff(),level,lives,health,gems,keys,px,py,sx,sy
  115.   bitmaddr.l=Addr BitMap(bitm)
  116.   bitm_bwidth=(Peek.w(bitmaddr)ASL 3)/#blockwidth
  117.   bitm_bheight=Peek.w(bitmaddr+2)/#blockheight
  118.   If bitm_bwidth>#mapwidth Then bitm_bwidth=#mapwidth
  119.   If bitm_bheight>#mapheight Then bitm_bheight=#mapheight
  120.  
  121.   If xpos+bitm_bwidth>=#mapwidth Then xpos=#mapwidth-bitm_bwidth
  122.   If ypos+bitm_bheight>=#mapheight Then ypos=#mapheight-bitm_bheight
  123.   If xpos<0 Then xpos=0
  124.   If ypos<0 Then ypos=0
  125.  
  126.   address+(xpos*#datasize)+(ypos*#mapwidth*#datasize)
  127.   Use BitMap bitm
  128.   x.w=8 : y.w=8           ; Pixel position of top-left corner of map
  129.   For yloop.w=0 To bitm_bheight-1
  130.     ad.l=address
  131.     For xloop.w=0 To bitm_bwidth-1
  132.       shap.w=#shapeoffset+Peek.w(ad)-#mapnull
  133.       ad+2
  134.        If shap=1 Then gems=gems+1       ; find no. of objects on a level
  135.        If shap=0 OR shap=1 OR shap=2 OR shap=3 OR shap=4 OR shap=5 Then Blit 0,x,y
  136.        If shap=>6 Then Blit shap,x,y
  137.        If shap=6 Then sx=x:sy=y:px=sx:py=sy
  138.        If shap=>32 Then Blit 0,x,y
  139.       If shap=1 OR shap=2 OR shap=3 OR shap=4 OR shap=5 OR shap=6 OR shap=7 OR shap=8
  140.        If AddItem(blk())                 ; store tiles in list array
  141.        USEPATH blk()
  142.        \shap=shap:\x=x:\y=y
  143.        EndIf
  144.       EndIf
  145.       If shap=>9 AND shap<=31
  146.        If AddItem(stf())
  147.        USEPATH stf()
  148.        \shap=shap:\x=x:\y=y
  149.        EndIf
  150.       EndIf
  151.       If shap=>32
  152.        If AddItem(stf())
  153.        USEPATH stf()
  154.        \shap=shap:\ex=x:\ey=y
  155.        EndIf
  156.       EndIf
  157.       x+#blockwidth
  158.     Next xloop
  159.     x=8
  160.     y+#blockheight
  161.     address+(#mapwidth*#datasize)
  162.   Next yloop
  163. End Statement
  164.  
  165. Statement DrawMyMap2{address.l,xpos.w,ypos.w,bitm.b}
  166.   bitmaddr.l=Addr BitMap(bitm)
  167.   bitm_bwidth=(Peek.w(bitmaddr)ASL 3)/#blockwidth
  168.   bitm_bheight=Peek.w(bitmaddr+2)/#blockheight
  169.   If bitm_bwidth>#mapwidth Then bitm_bwidth=#mapwidth
  170.   If bitm_bheight>#mapheight Then bitm_bheight=#mapheight
  171.  
  172.   If xpos+bitm_bwidth>=#mapwidth Then xpos=#mapwidth-bitm_bwidth
  173.   If ypos+bitm_bheight>=#mapheight Then ypos=#mapheight-bitm_bheight
  174.   If xpos<0 Then xpos=0
  175.   If ypos<0 Then ypos=0
  176.  
  177.   address+(xpos*#datasize)+(ypos*#mapwidth*#datasize)
  178.   Use BitMap bitm
  179.   x.w=8 : y.w=8           ; Pixel position of top-left corner of map
  180.   For yloop.w=0 To bitm_bheight-1
  181.     ad.l=address
  182.     For xloop.w=0 To bitm_bwidth-1
  183.       shap.w=#shapeoffset+Peek.w(ad)-#mapnull
  184.       ad+2
  185.        If shap=0 OR shap=1 OR shap=2 OR shap=3 OR shap=4 OR shap=5 Then Blit 0,x,y
  186.        If shap=>6 Then Blit shap,x,y
  187.        If shap=>32 Then Blit 0,x,y
  188.       x+#blockwidth
  189.     Next xloop
  190.     x=8
  191.     y+#blockheight
  192.     address+(#mapwidth*#datasize)
  193.   Next yloop
  194. End Statement
  195.  
  196. LoadShapes 0,"Gfx/ar.shp"
  197. LoadShapes 2,"Gfx/title.shp"
  198.  
  199. LoadPalette 0,"Gfx/game.pal"
  200.  
  201. LoadMedModule 0,"Music/title.med"
  202.  
  203. LoadBlitzFont 0,"2001.font"
  204.  
  205. suc=OpenFile(0,"Data/highscores")
  206.   If suc=0
  207.      For n=0 To 9
  208.        highname$(n)="Graham"
  209.        highpoints(n)=0
  210.      Next n
  211.   EndIf
  212.   If suc=-1
  213.      Fields 0,highname$(0)
  214.      Fields 0,highname$(1)
  215.      Fields 0,highname$(2)
  216.      Fields 0,highname$(3)
  217.      Fields 0,highname$(4)
  218.      Fields 0,highname$(5)
  219.      Fields 0,highname$(6)
  220.      Fields 0,highname$(7)
  221.      Fields 0,highname$(8)
  222.      Fields 0,highname$(9)
  223.      Fields 0,highpoints(0)
  224.      Fields 0,highpoints(1)
  225.      Fields 0,highpoints(2)
  226.      Fields 0,highpoints(3)
  227.      Fields 0,highpoints(4)
  228.      Fields 0,highpoints(5)
  229.      Fields 0,highpoints(6)
  230.      Fields 0,highpoints(7)
  231.      Fields 0,highpoints(8)
  232.      Fields 0,highpoints(9)
  233.      Get 0,0
  234.      CloseFile 0
  235.   EndIf
  236.  
  237. For n=0 To 9
  238.     If highname$(n)="" Then highname$(n)="Graham"
  239. Next n
  240.  
  241. For n=2 To 7
  242.     Handle n,0,0
  243. Next n
  244.  
  245. BitMap 0,320,256,5 : Buffer 0,16384
  246. BitMap 1,320,256,5 : Buffer 1,16384
  247. BitMap 2,320,256,5
  248. BitMap 3,320,256,5
  249. BitMap 4,320,256,5
  250. BitMap 5,320,256,5
  251.  
  252. InitCopList 0,$00005
  253.  
  254. Use BitMap 0:Blit 2,20,4:Blit 3,130,160:Blit 4,130,180:Blit 6,130,200
  255. Use BitMap 1:Blit 2,20,4:Blit 3,130,160:Blit 4,130,180:Blit 6,130,200
  256. Use BitMap 2:Blit 0,23,112
  257. Use BitMap 3:Blit 1,124,119
  258.  
  259. VWait 100
  260.  
  261. BLITZ:BlitzKeys On:BitMapOutput 2:BitMapOutput 3:Colour 1
  262. CreateDisplay 0:DisplayPalette 0,0
  263. StartMedModule 0
  264.  
  265. Repeat
  266.   VWait
  267.   PlayMed
  268.   DisplayBitMap 0,2
  269.   count=count+1
  270. Until count>200 OR Joyb(1) OR RawStatus($40)
  271.  
  272. count=0:DisplayBitMap 0,4:Use BitMap 2:Cls
  273. Repeat:VWait:PlayMed:count=count+1:Until count>100
  274.  
  275. count=0
  276.  
  277. Repeat
  278.   VWait
  279.   PlayMed
  280.   DisplayBitMap 0,3
  281.   count=count+1
  282. Until count>200 OR Joyb(1) OR RawStatus($40)
  283.  
  284. count=0:DisplayBitMap 0,4:Use BitMap 3:Cls
  285. Repeat:VWait:PlayMed:count=count+1:Until count>100
  286.  
  287. VWait
  288. ;PlayMed
  289.  
  290. count=0
  291.  
  292. BitMapOutput 2:Use BitMap 2:Colour 1
  293. Locate 0,0:NPrint "               HIGH SCORES              "
  294.  For n=0 To 9
  295.    Locate 0,n+2:Format "######0":NPrint highname$(n):Locate 33,n+2:NPrint highpoints(n)
  296.  Next n
  297.  
  298. BitMapOutput 3:Use BitMap 3:Colour 1
  299. Locate 0,0 :NPrint "           ALTERNATE REALITIES          "
  300. Locate 0,1 :NPrint "                presents                "
  301. Locate 0,2 :NPrint "                  BLOBZ                 "
  302. Locate 0,3 :NPrint "     (c) 2003-04 Alternate Realities    "
  303. Locate 0,14:NPrint "Programming and Gfx -    Graham Humphrey"
  304. Locate 0,15:NPrint "Level Design - Graham and Simon Humphrey"
  305. Locate 0,16:NPrint "Sfx and Music -    taken from various PD"
  306. Locate 0,17:NPrint "                                   games"
  307. Locate 0,28:NPrint "       Written in BLITZ BASIC 2.1       "
  308. Locate 0,29:NPrint "         This game is freeware          "
  309. Locate 0,31:NPrint "   See 'Blobz.guide' for instructions   "
  310.  
  311. .maintitle
  312.  
  313. Repeat
  314.  
  315.   VWait
  316.   PlayMed
  317.   DisplayBitMap 0,0:db=1-db:Use BitMap db:UnBuffer db
  318.  
  319.   jy=Joyy(1)
  320.   jb=Joyb(1)
  321.  
  322.   If RawStatus($4c) Then jy=-1
  323.   If RawStatus($4d) Then jy=1
  324.   If RawStatus($40) Then jb=1
  325.  
  326.   If jy=-1 AND y>160 Then y=y-20
  327.   If jy=1 AND y<200 Then y=y+20
  328.  
  329.   If jb<>0 AND y=160                ; start the game!
  330.      VWait
  331.      DisplayBitMap 0,4
  332.      Use BitMap 0:Cls:Use BitMap 1:Cls
  333.      UnBuffer 0:UnBuffer 1:UnBuffer db
  334.      Free BitMap 0:Free BitMap 1:Free BitMap 2:Free BitMap 3
  335.      For v=64 To 0 Step -0.5
  336.         VWait
  337.         PlayMed
  338.         SetMedVolume v
  339.      Next v
  340.      StopMed
  341.      Goto game
  342.   EndIf
  343.  
  344.   If jb<>0 AND y=180                ; load game
  345.      DisplayBitMap 0,4:Format "0"
  346.      Use BitMap 4:BitMapOutput 4:Colour 1:BlitzKeys On:done=0
  347.      Locate 0,15:NPrint "         GAME NUMBER? 1 to 9         "
  348.      Repeat
  349.        VWait
  350.        PlayMed
  351.        If RawStatus($01) Then sav=1:Gosub loadgame
  352.        If RawStatus($02) Then sav=2:Gosub loadgame
  353.        If RawStatus($03) Then sav=3:Gosub loadgame
  354.        If RawStatus($04) Then sav=4:Gosub loadgame
  355.        If RawStatus($05) Then sav=5:Gosub loadgame
  356.        If RawStatus($06) Then sav=6:Gosub loadgame
  357.        If RawStatus($07) Then sav=7:Gosub loadgame
  358.        If RawStatus($08) Then sav=8:Gosub loadgame
  359.        If RawStatus($09) Then sav=9:Gosub loadgame
  360.      Until done=1
  361.      Use BitMap 0:Cls:Use BitMap 1:Cls
  362.      UnBuffer 0:UnBuffer 1:UnBuffer db
  363.      Free BitMap 0:Free BitMap 1:Free BitMap 2:Free BitMap 3
  364.      Use BitMap 4:Cls
  365.      For v=64 To 0 Step -0.5
  366.         VWait
  367.         PlayMed
  368.         SetMedVolume v
  369.      Next v
  370.      StopMed
  371.      level=levela
  372.      Goto game
  373.   EndIf
  374.  
  375.   If jb<>0 AND y=200                ; quit
  376.      For v=64 To 0 Step -0.5
  377.         VWait
  378.         PlayMed
  379.         SetMedVolume v
  380.      Next v
  381.      StopMed
  382.      Goto cleanup
  383.   EndIf
  384.  
  385.   Buffer db,16384
  386.   BBlit db,7,x,y
  387.  
  388.   count=count+1
  389.   If count>1000 Then Gosub highscores
  390.   If count>1500 Then Gosub info
  391.  
  392. Forever
  393.  
  394. .highscores
  395.  
  396. Repeat
  397.   VWait
  398.   PlayMed
  399.   DisplayBitMap 0,2
  400.   count=count+1
  401.   If Joyb(1)<>0 OR RawStatus($40) Then count=1500
  402. Until count>1500
  403.  
  404. Return
  405.  
  406. .info
  407.  
  408. Repeat
  409.   VWait
  410.   PlayMed
  411.   DisplayBitMap 0,3
  412.   count=count+1
  413.   If Joyb(1)<>0 OR RawStatus($40) Then count=2000
  414. Until count>2000
  415. count=0
  416.  
  417. Return
  418.  
  419. .game
  420.  
  421. QAMIGA:Format "0":done=0:sav=0
  422. If level>9 Then Format "00"
  423. InitCopList 0,96,214,$00015,8,32,0
  424. InitCopList 1,44,50,$00005,8,32,0
  425. InitCopList 2,$00005
  426.  
  427. BitMap 2,320,50,#maxdepth
  428. BitMap 3,320,256,5
  429. BitMap 4,320,256,5
  430.  
  431. LoadShape 101,"Gfx/loading.iff"
  432. LoadPalette 0,"Gfx/game.pal"
  433.  
  434. Blit 101,120,90
  435. BLITZ
  436. CreateDisplay 2:DisplayBitMap 2,4:DisplayPalette 2,0
  437.  
  438. QAMIGA
  439. ; load in graphics
  440. LoadShapes 48,56,"Gfx/player.shp" :For n=48 To 56:MidHandle n:Next n
  441. LoadShapes 57,65,"Gfx/enemy1.shp" :For n=57 To 65:MidHandle n:Next n
  442. LoadShapes 66,74,"Gfx/enemy2.shp" :For n=66 To 74:MidHandle n:Next n
  443. LoadShapes 75,83,"Gfx/enemy3.shp" :For n=75 To 83:MidHandle n:Next n
  444. LoadShapes 84,92,"Gfx/enemy4.shp" :For n=84 To 92:MidHandle n:Next n
  445. LoadShapes 93,99,"Gfx/objects.shp":For n=93 To 99:MidHandle n:Next n
  446. LoadShape 100,"Gfx/panel.iff":LoadShape 102,"Gfx/gameover.iff"
  447.  
  448. ; load in sounds
  449. LoadSound 0,"Sfx/comp.snd"
  450. LoadSound 1,"Sfx/die.snd"
  451. LoadSound 2,"Sfx/gameover.snd"
  452. LoadSound 3,"Sfx/gem.snd"
  453. LoadSound 4,"Sfx/health.snd"
  454. LoadSound 5,"Sfx/hit.snd"
  455. LoadSound 6,"Sfx/key.snd"
  456. LoadSound 7,"Sfx/life.snd"
  457. LoadSound 8,"Sfx/pts.snd"
  458. LoadSound 9,"Sfx/door.snd"
  459. LoadSound 10,"Sfx/warning.snd"
  460. LoadSound 11,"Sfx/hiscore.snd"
  461.  
  462. ; load font
  463. LoadBlitzFont 0,"2001.font"
  464.  
  465. .setup
  466.  
  467. done=0
  468.  
  469. If level=>1 Then shapefile$="Gfx/world1.shp":LoadShape 93,"Gfx/gem1.iff":MidHandle 93
  470. If level=>11 Then shapefile$="Gfx/world2.shp":LoadShape 93,"Gfx/gem2.iff":MidHandle 93
  471. If level=>21 Then shapefile$="Gfx/world3.shp":LoadShape 93,"Gfx/gem3.iff":MidHandle 93
  472. If level=>31
  473.    shapefile$="Gfx/world4.shp"
  474.    LoadShape 93,"Gfx/gem4.iff":MidHandle 93
  475.    LoadShape 94,"Gfx/key4.iff":MidHandle 94
  476.    LoadShape 97,"Gfx/heart4.iff":MidHandle 97
  477. EndIf
  478. If level=>41
  479.    shapefile$="Gfx/world5.shp"
  480.    LoadShape 93,"Gfx/gem5.iff":MidHandle 93
  481.    LoadShape 94,"Gfx/key.iff":MidHandle 94
  482.    LoadShape 97,"Gfx/heart.iff":MidHandle 97
  483. EndIf
  484.  
  485. BitMap 0,640,512,#maxdepth : Buffer 0,16384
  486. BitMap 1,640,512,#maxdepth : Buffer 1,16384
  487.  
  488. mapfile$="Level/"+Str$(level)
  489. palettefile$="Gfx/game.pal"
  490.  
  491. DEFTYPE.w
  492.  
  493. ; Can we open our map file?
  494. suc=OpenFile(0,mapfile$)
  495. size=Lof(0)
  496. If suc=0 OR size=0 Then End
  497.  
  498. ; Yup - so get some memory to store it in
  499. mapad.l=AllocMem(size,1)
  500. If mapad=0 Then End
  501. ReadMem 0,mapad,size                      ; Read in map
  502. CloseFile 0
  503.  
  504. ; Load those shapes in
  505. If Exists(shapefile$)
  506.   LoadShapes 0,47,shapefile$:For n=0 To 47:MidHandle n:Next n
  507. Else
  508.   End
  509. EndIf
  510.  
  511. ; Load the palette in if we've got one
  512. If Exists(palettefile$) AND palettefile$<>""
  513.   LoadPalette 0,palettefile$
  514. EndIf
  515.  
  516. ; Draw map
  517.   Use BitMap 0
  518.   Cls
  519.   DrawMyMap{mapad,0,0,0}
  520.   Use BitMap 1
  521.   Cls
  522.   DrawMyMap2{mapad,0,0,1}
  523.  
  524. db=0:p=48:scrollx=0:scrolly=0:liveslost=0:healthlost=0:gemcoll=0:timelost=0
  525.  
  526. If level=6 Then gems=gems-1
  527. If level=13 Then gems=gems-1
  528. If level=14 Then gems=gems-1
  529. If level=28 Then gems=gems-1
  530. If level=34 Then gems=gems-1
  531. If level=35 Then gems=gems-1
  532. If level=36 Then gems=gems-1
  533. If level=42 Then gems=gems-1
  534. If level=45 Then gems=gems-1
  535. If level=47 Then gems=gems-1
  536.  
  537. If FirstItem(stf())=-1        ; sort out enemy's position
  538.  USEPATH stf()
  539.    While NextItem(stf())=-1
  540.     If \shap=32 Then \typ=1:\p=1:\shap=60:\sp=2:\l=1  ; red left
  541.     If \shap=33 Then \typ=2:\p=1:\shap=69:\sp=4:\l=3  ; green left
  542.     If \shap=34 Then \typ=3:\p=1:\shap=78:\sp=8:\l=5  ; yellow left
  543.     If \shap=35 Then \typ=4:\p=1:\shap=87:\sp=16:\l=7 ; blue left
  544.     If \shap=36 Then \typ=4:\p=2:\shap=85:\sp=16:\l=7 ; blue right
  545.     If \shap=37 Then \typ=3:\p=2:\shap=76:\sp=8:\l=5  ; yellow right
  546.     If \shap=38 Then \typ=2:\p=2:\shap=67:\sp=4:\l=3  ; green right
  547.     If \shap=39 Then \typ=1:\p=2:\shap=58:\sp=2:\l=1  ; red right
  548.     If \shap=40 Then \typ=1:\p=3:\shap=61:\sp=2:\l=2  ; red down
  549.     If \shap=41 Then \typ=2:\p=3:\shap=70:\sp=4:\l=4  ; green down
  550.     If \shap=42 Then \typ=3:\p=3:\shap=79:\sp=8:\l=6  ; yellow down
  551.     If \shap=43 Then \typ=4:\p=3:\shap=88:\sp=16:\l=8 ; blue down
  552.     If \shap=44 Then \typ=4:\p=4:\shap=86:\sp=16:\l=8 ; blue up
  553.     If \shap=45 Then \typ=3:\p=4:\shap=77:\sp=8:\l=6  ; yellow up
  554.     If \shap=46 Then \typ=2:\p=4:\shap=68:\sp=4:\l=4  ; green up
  555.     If \shap=47 Then \typ=1:\p=4:\shap=59:\sp=2:\l=2  ; red up
  556.    Wend
  557. EndIf
  558.  
  559. If complete=1
  560.    If FirstItem(stf())=-1
  561.    USEPATH stf()
  562.     While NextItem(stf())=-1
  563.      If \l=1 OR \l=3 OR \l=5
  564.          \typ=4:\sp=16:\l=7
  565.          If \p=1 Then \shap=87:If \p=2 Then \shap=85
  566.      EndIf
  567.      If \l=2 OR \l=4 OR \l=6
  568.         \typ=4:\sp=16:\l=8
  569.          If \p=3 Then \shap=88:If \p=4 Then \shap=86
  570.      EndIf
  571.     Wend
  572.    EndIf
  573. EndIf
  574.  
  575. If level=1 Then time=4000
  576. If level=2 Then time=2500
  577. If level=3 Then time=3000
  578. If level=4 Then time=3000
  579. If level=5 Then time=4000
  580. If level=6 Then time=3500
  581. If level=7 Then time=4500
  582. If level=8 Then time=4000
  583. If level=9 Then time=3000
  584. If level=10 Then time=2500
  585. If level=11 Then time=4500
  586. If level=12 Then time=3000
  587. If level=13 Then time=3000
  588. If level=14 Then time=3000
  589. If level=15 Then time=3750
  590. If level=16 Then time=2250
  591. If level=17 Then time=3000
  592. If level=18 Then time=2000
  593. If level=19 Then time=3750
  594. If level=20 Then time=5000
  595. If level=21 Then time=3000
  596. If level=22 Then time=3000
  597. If level=23 Then time=3000
  598. If level=24 Then time=3000
  599. If level=25 Then time=3000
  600. If level=26 Then time=3000
  601. If level=27 Then time=3000
  602. If level=28 Then time=4000
  603. If level=29 Then time=3000
  604. If level=30 Then time=4500
  605. If level=31 Then time=4500
  606. If level=32 Then time=3000
  607. If level=33 Then time=3500
  608. If level=34 Then time=3000
  609. If level=35 Then time=3000
  610. If level=36 Then time=3000
  611. If level=37 Then time=4000
  612. If level=38 Then time=3000
  613. If level=39 Then time=3000
  614. If level=40 Then time=3750
  615. If level=41 Then time=3750
  616. If level=42 Then time=3000
  617. If level=43 Then time=3500
  618. If level=44 Then time=3500
  619. If level=45 Then time=3500
  620. If level=46 Then time=3500
  621. If level=47 Then time=3500
  622. If level=48 Then time=3500
  623. If level=49 Then time=3000
  624. If level=50 Then time=4500
  625.  
  626. If FirstItem(blk())=-1
  627.  USEPATH blk()
  628.    While NextItem(blk())=-1
  629.     If \shap=6 Then px=\x:py=\y ; find starting position
  630.    Wend
  631. EndIf
  632.  
  633. VWait 100:BLITZ:BlitzKeys On:BitMapOutput 2:Colour 1
  634. CreateDisplay 1,0
  635. DisplayPalette 0,0:DisplayPalette 1,0
  636. Use BitMap 2:Blit 100,2,2:Free BitMap 4
  637.  
  638. ; *** START OF MAIN LOOP ***
  639.  
  640. .mainloop
  641.  
  642. Repeat
  643.  
  644.   VWait                           ; Display game screen
  645.   DisplayBitMap 0,db,scrollx,scrolly:DisplayBitMap 1,2:db=1-db:Use BitMap db:UnBuffer db
  646.  
  647.   jx=Joyx(1)
  648.   jy=Joyy(1)
  649.   jb=Joyb(1)
  650.  
  651.   Gosub checkitems
  652.   Gosub checkcontrols
  653.   Gosub checkstatus
  654.   Gosub checkcoll
  655.  
  656.   BBlit db,p,px,py
  657.  
  658.   time=time-2
  659.  
  660. If cheat=1
  661.   If RawStatus($21) Then gems=0:Sound 0,8:Goto nextlev     ; skip level
  662.   If RawStatus($28) Then lives=lives+1                     ; extra life
  663.   If RawStatus($25) Then health=health+1                   ; extra health
  664.   If RawStatus($27) Then health=0                          ; er, kill yourself
  665. EndIf
  666.  
  667. Until RawStatus($45):score=-1:Goto gameover
  668.  
  669. ; *** END OF MAIN LOOP ***
  670.  
  671. .checkitems
  672.  
  673.  If FirstItem(blk())=-1
  674.   USEPATH blk()
  675.     While NextItem(blk())=-1
  676.      UnBuffer db
  677.      If NOT \x<scrollx OR \y<scrolly OR \x=>scrollx+330 OR \y=>scrolly+220
  678.       If \shap=0 Then BBlit db,0,\x,\y
  679.       If \shap=1 Then BBlit db,93,\x,\y ; gem
  680.       If \shap=2 Then BBlit db,94,\x,\y ; key
  681.       If \shap=3 Then BBlit db,95,\x,\y ; extra life
  682.       If \shap=4 Then BBlit db,96,\x,\y ; pts
  683.       If \shap=5 Then BBlit db,97,\x,\y ; health
  684.       If \shap=7 Then BBlit db,98,\x,\y ; door horiz
  685.       If \shap=8 Then BBlit db,99,\x,\y ; door vert
  686.       If \shap=70 Then BBlit db,7,\x,\y
  687.       If \shap=80 Then BBlit db,8,\x,\y
  688.      If ShapesHit(p,px,py,\shap,\x,\y)
  689.       If \shap=1 Then \shap=0:gems=gems-1:gemcoll=gemcoll+1:Sound 3,8:score=score+5:If gems<1 Then Sound 10,8
  690.       If \shap=2 Then \shap=0:keys=keys+1:Sound 6,8:score=score+2
  691.       If \shap=3 Then \shap=0:lives=lives+1:Sound 7,8
  692.       If \shap=4 Then \shap=0:score=score+100:Sound 8,8
  693.       If \shap=5 Then \shap=0:health=health+1:Sound 4,8
  694.      EndIf
  695.      If ShapesHit(51,px,py,98,\x,\y) OR ShapesHit(49,px+4,py,98,\x,\y)
  696.         If keys=0 AND p=51 AND \shap=7 Then px=px+4:If px>180 AND scrollx<320 Then scrollx=scrollx+4
  697.         If keys=0 AND p=49 AND \shap=7 Then px=px-4:If px>180 AND scrollx>0 Then scrollx=scrollx-4
  698.         If keys>0 AND \shap=7 Then \shap=70:keys=keys-1:Sound 9,8
  699.      If ShapesHit(50,px,py,99,\x,\y) OR ShapesHit(52,px,py+4,99,\x,\y)
  700.         If keys=0 AND p=50 AND \shap=8 Then py=py+4:If py>160 AND scrolly<300 Then scrolly=scrolly+4
  701.         If keys=0 AND p=52 AND \shap=8 Then py=py-4:If py>160 AND scrolly>0 Then scrolly=scrolly-4
  702.         If keys>0 AND \shap=8 Then \shap=80:keys=keys-1:Sound 9,8
  703.      EndIf
  704.      EndIf
  705.      EndIf
  706.      Buffer db,16384
  707.     Wend
  708.  EndIf
  709.  
  710. Return
  711.  
  712. .checkcontrols
  713.  
  714. UnBuffer db
  715.  
  716.   If RawStatus($4c) Then jy=-1
  717.   If RawStatus($4d) Then jy=1
  718.   If RawStatus($4f) Then jx=-1
  719.   If RawStatus($4e) Then jx=1
  720.   If RawStatus($40) Then jb=1
  721.  
  722. If jx=-1 AND px>0    ; left
  723.    p=51
  724.    px=px-4
  725.    If px>180 AND scrollx>0 Then scrollx=scrollx-4
  726. EndIf
  727.  
  728. If jx=1 AND px<620   ; right
  729.    p=49
  730.    px=px+4
  731.    If px>180 AND scrollx<320 Then scrollx=scrollx+4
  732. EndIf
  733.  
  734. If jy=-1 AND py>0    ; up
  735.    p=50
  736.    py=py-4
  737.    If py>160 AND scrolly>0 Then scrolly=scrolly-4
  738. EndIf
  739.  
  740. If jy=1 AND py<500   ; down
  741.    p=52
  742.    py=py+4
  743.    If py>160 AND scrolly<300 Then scrolly=scrolly+4
  744. EndIf
  745.  
  746. If jx=-1 AND jy=-1 Then p=53 ; up-left
  747. If jx=-1 AND jy=1 Then p=55  ; up-right
  748. If jx=1 AND jy=-1 Then p=54  ; down-left
  749. If jx=1 AND jy=1 Then p=56   ; down-right
  750.  
  751. Buffer db,16384
  752.  
  753. Return
  754.  
  755. .checkstatus
  756.  
  757. Format "#0":Locate 3,2.4:NPrint gems
  758. Format "#0":Locate 8,2.4:NPrint keys
  759. Format "#0":Locate 13,2.4:NPrint lives
  760. Format "#0":Locate 17,2.4:NPrint health
  761. Format "#0":Locate 24,2.4:NPrint level
  762. Format "######0":Locate 31,2.4:NPrint score
  763. Format "0":Locate 27,1:NPrint "TIME - "+Str$(Int(time/3000))+":"
  764. Format "00":Locate 36,1:NPrint Str$(Int(temp))
  765. temp=Int(time/50)
  766. If temp>60
  767.  Repeat
  768.   temp-60
  769.  Until temp<60
  770. EndIf
  771.  
  772. If temp=60 Then temp=0
  773. If lives<0 Then Goto gameover
  774.  
  775. If health=0 OR time=0
  776.    px=sx:py=sy:lives=lives-1:liveslost=liveslost+1
  777.    Sound 1,8:p=48
  778.    scrollx=0:scrolly=0
  779.    health=3
  780.    If time=0 Then time=3000:timelost=1
  781. EndIf
  782.  
  783. If RawStatus($19)            ; pause
  784.    Repeat
  785.    Until Joyb(1)=1 OR RawStatus($40)
  786. EndIf
  787.  
  788. Return
  789.  
  790. .checkcoll
  791.  
  792. If FirstItem(stf())=-1
  793.    USEPATH stf()
  794.    While NextItem(stf())=-1
  795.    If \typ>0 Then BBlit db,\shap,\ex,\ey
  796.    If NOT \x<scrollx OR \y<scrolly OR \x=>scrollx+330 OR \y=>scrolly+220
  797.     If ShapesHit(p,px,py,\shap,\x,\y)
  798.      If \shap=9 Then health=0 ; if collide with black space then death!
  799.       If ShapesHit(p,px,py,\shap,\x,\y) AND p=50 AND \shap=12 Then py=py-4:If py>160 AND scrolly>0 Then scrolly=scrolly-4
  800.       If ShapesHit(p,px,py,\shap,\x,\y) AND p=51 AND \shap=12 Then px=px-4:If px>180 AND scrollx>0 Then scrollx=scrollx-4
  801.       If ShapesHit(p,px+4,py,\shap,\x,\y) AND p=49 AND \shap=12 Then px=px+4:If px>180 AND scrollx<320 Then scrollx=scrollx+4
  802.       If ShapesHit(p,px,py+4,\shap,\x,\y) AND p=52 AND \shap=12 Then py=py+4:If py>160 AND scrolly<300 Then scrolly=scrolly+4
  803.       If \shap=13 Then px=px+4:If px>180 AND scrollx<320 Then scrollx=scrollx+4
  804.       If \shap=14 Then py=py-4:If py>160 AND scrolly>0 Then scrolly=scrolly-4
  805.       If \shap=15 Then px=px-4:If px>180 AND scrollx>0 Then scrollx=scrollx-4
  806.       If \shap=16 Then py=py+4:If py>160 AND scrolly<300 Then scrolly=scrolly+4
  807.      If \shap=10 OR \shap=11 AND gems=0:Sound 0,8:Goto nextlev:EndIf ; if exit
  808.     EndIf
  809.     ; collision with walls
  810.     If ShapesHit(51,px,py,\shap,\x,\y) AND \shap=>17 AND \shap=<31 Then px=px+4:If scrollx<320 AND px>180 Then scrollx=scrollx+4
  811.     If ShapesHit(49,px+2,py,\shap,\x,\y) AND \shap=>17 AND \shap=<31 Then px=px-4:If scrollx>0 AND px>180 Then scrollx=scrollx-4
  812.     If ShapesHit(50,px,py,\shap,\x,\y) AND \shap=>17 AND \shap=<31 Then py=py+4:If scrolly<300 AND py>160 Then scrolly=scrolly+4
  813.     If ShapesHit(52,px,py+2,\shap,\x,\y) AND \shap=>17 AND \shap=<31 Then py=py-4:If scrolly>0 AND py>160 Then scrolly=scrolly-4
  814.    EndIf
  815.     ; move enemies
  816.      If \l=1
  817.       If \p=1 Then \shap=60:If \p=2 Then \shap=58
  818.       If \p=1 AND \ex>8 Then \ex=\ex-\sp Else \ex=\ex+\sp:\p=2
  819.       If \p=2 AND \ex<620 Then \ex=\ex+\sp Else \ex=\ex-\sp:\p=1
  820.      EndIf
  821.      If \l=2
  822.       If \p=3 Then \shap=61:If \p=4 Then \shap=59
  823.       If \p=3 AND \ey<496 Then \ey=\ey+\sp Else \ey=\ey-\sp:\p=4
  824.       If \p=4 AND \ey>8 Then \ey=\ey-\sp:Else \ey=\ey+\sp:\p=3
  825.      EndIf
  826.      If \l=3
  827.       If \p=1 Then \shap=69:If \p=2 Then \shap=67
  828.       If \p=1 AND \ex>8 Then \ex=\ex-\sp Else \ex=\ex+\sp:\p=2
  829.       If \p=2 AND \ex<620 Then \ex=\ex+\sp Else \ex=\ex-\sp:\p=1
  830.      EndIf
  831.      If \l=4
  832.       If \p=3 Then \shap=70:If \p=4 Then \shap=68
  833.       If \p=3 AND \ey<496 Then \ey=\ey+\sp Else \ey=\ey-\sp:\p=4
  834.       If \p=4 AND \ey>8 Then \ey=\ey-\sp:Else \ey=\ey+\sp:\p=3
  835.      EndIf
  836.      If \l=5
  837.       If \p=1 Then \shap=78:If \p=2 Then \shap=76
  838.       If \p=1 AND \ex>8 Then \ex=\ex-\sp Else \ex=\ex+\sp:\p=2
  839.       If \p=2 AND \ex<620 Then \ex=\ex+\sp Else \ex=\ex-\sp:\p=1
  840.      EndIf
  841.      If \l=6
  842.       If \p=3 Then \shap=79:If \p=4 Then \shap=77
  843.       If \p=3 AND \ey<496 Then \ey=\ey+\sp Else \ey=\ey-\sp:\p=4
  844.       If \p=4 AND \ey>8 Then \ey=\ey-\sp:Else \ey=\ey+\sp:\p=3
  845.      EndIf
  846.      If \l=7
  847.       If \p=1 Then \shap=87:If \p=2 Then \shap=85
  848.       If \p=1 AND \ex>33 Then \ex=\ex-\sp Else \ex=\ex+\sp:\p=2
  849.       If \p=2 AND \ex<620 Then \ex=\ex+\sp Else \ex=\ex-\sp:\p=1
  850.      EndIf
  851.      If \l=8
  852.       If \p=3 Then \shap=88:If \p=4 Then \shap=86
  853.       If \p=3 AND \ey<496 Then \ey=\ey+\sp Else \ey=\ey-\sp:\p=4
  854.       If \p=4 AND \ey>33 Then \ey=\ey-\sp:Else \ey=\ey+\sp:\p=3
  855.      EndIf
  856.     ; collision with enemies
  857.     If ShapesHit(p,px,py,\shap,\ex,\ey)
  858.        If \shap=>32 Then health=health-1:healthlost=healthlost+1
  859.        Sound 5,8
  860.     EndIf
  861.    Wend
  862. EndIf
  863.  
  864. Return
  865.  
  866. .nextlev
  867.  
  868. QAMIGA:Use BitMap 3:Cls:BLITZ
  869. score=score+50:keys=0
  870. DisplayBitMap 0,3,0,0:DisplayPalette 0,0
  871. Use BitMap 0:Cls:Use BitMap 1:Cls
  872. UnBuffer 0:UnBuffer 1:UnBuffer db
  873. BitMapOutput 3:Use BitMap 3:Colour 1
  874. Locate 0,1:NPrint "             LEVEL COMPLETE            "
  875. Locate 0,3:Format "##0":NPrint "GEM BONUS                           ",gemcoll:score=score+gemcoll
  876. Locate 0,4:NPrint "LEVEL BONUS                          50"
  877. If timelost=0
  878.    Locate 0,5:Format "##0":NPrint "TIME BONUS                          "+Str$(Int(time/50)):score=score+(time/50)
  879. EndIf
  880. If liveslost=0 AND healthlost=0
  881.    Locate 0,6:NPrint "NO HARM DONE BONUS                  125":score=score+125
  882. EndIf
  883. If level=10 OR level=20 OR level=30 OR level=40 OR level=50
  884.    Locate 0,7:NPrint "WORLD BONUS                         200":score=score+200
  885. EndIf
  886. If level=5 OR level=10 OR level=15 OR level=20 OR level=25 OR level=30 OR level=35 OR level=40 OR level=45
  887.    BlitzKeys On:done=0:Format "0"
  888.    While NOT RawStatus($15) OR RawStatus($36):Locate 0,20:NPrint "          SAVE GAME? (Y or N)         ":Wend
  889.    If RawStatus($15)
  890.    Repeat
  891.        Locate 0,22:NPrint "          GAME NUMBER? 1 to 9        "
  892.          If RawStatus($01) Then sav=1:Gosub savegame
  893.          If RawStatus($02) Then sav=2:Gosub savegame
  894.          If RawStatus($03) Then sav=3:Gosub savegame
  895.          If RawStatus($04) Then sav=4:Gosub savegame
  896.          If RawStatus($05) Then sav=5:Gosub savegame
  897.          If RawStatus($06) Then sav=6:Gosub savegame
  898.          If RawStatus($07) Then sav=7:Gosub savegame
  899.          If RawStatus($08) Then sav=8:Gosub savegame
  900.          If RawStatus($09) Then sav=9:Gosub savegame
  901.    Until RawStatus($36) OR done=1
  902.    EndIf
  903. EndIf
  904. If level=50
  905.    Locate 14,22:NPrint "PRESS FIRE"
  906.    Repeat:Until Joyb(1)=1 OR RawStatus($40)
  907. EndIf
  908. Format "0":level=level+1:If level>9 Then Format "00"
  909. QAMIGA
  910. For n=0 To 47
  911.   Free Shape n
  912. Next n
  913. Free BitMap 0:Free BitMap 1
  914. scrollx=0:scrolly=0
  915. If LastItem(blk())
  916.    USEPATH blk()
  917.    While PrevItem(blk())
  918.     \shap=0:\x=0:\y=0
  919.     KillItem blk()
  920.    Wend
  921. EndIf
  922. If FirstItem(blk())
  923.    USEPATH blk()
  924.    \shap=0:\x=0:\y=0
  925.    KillItem blk()
  926. EndIf
  927. If LastItem(stf())
  928.    USEPATH stf()
  929.    While PrevItem(stf())
  930.     \shap=0:\x=0:\y=0:\p=0:\typ=0:\l=0:\ex=0:\ey=0:\sp=0
  931.     KillItem stf()
  932.    Wend
  933. EndIf
  934. If FirstItem(stf())
  935.    USEPATH stf()
  936.    While NextItem(stf())
  937.     \shap=0:\x=0:\y=0:\p=0:\typ=0:\l=0:\ex=0:\ey=0:\sp=0
  938.     KillItem stf()
  939.    Wend
  940. EndIf
  941. ClearList blk():ClearList stf()
  942. If level>#maxlevels Then Goto finish
  943. Goto setup
  944.  
  945. .gameover
  946.  
  947. QAMIGA:Use BitMap 3:Cls:Blit 102,82,88:BLITZ
  948. DisplayBitMap 0,3,0,0:DisplayPalette 0,0
  949. Sound 2,8
  950. If cheat=1 Then score=-1
  951. Repeat
  952. Until Joyb(1)=1 OR RawStatus($40)
  953. CreateDisplay 2:DisplayBitMap 2,5:DisplayPalette 2,0
  954. If LastItem(blk())
  955.    USEPATH blk()
  956.    While PrevItem(blk())
  957.     \shap=0:\x=0:\y=0
  958.     KillItem blk()
  959.    Wend
  960. EndIf
  961. If FirstItem(blk())
  962.    USEPATH blk()
  963.    \shap=0:\x=0:\y=0
  964.    KillItem blk()
  965. EndIf
  966. If LastItem(stf())
  967.    USEPATH stf()
  968.    While PrevItem(stf())
  969.     \shap=0:\x=0:\y=0:\p=0:\typ=0:\l=0:\ex=0:\ey=0:\sp=0
  970.     KillItem stf()
  971.    Wend
  972. EndIf
  973. If FirstItem(stf())
  974.    USEPATH stf()
  975.    While NextItem(stf())
  976.     \shap=0:\x=0:\y=0:\p=0:\typ=0:\l=0:\ex=0:\ey=0:\sp=0
  977.     KillItem stf()
  978.    Wend
  979. EndIf
  980. ClearList blk():ClearList stf()
  981. If score>highpoints(9)
  982.    Sound 11,8
  983.    DisplayBitMap 2,3:DisplayPalette 2,0:BitMapOutput 3:BlitzKeys On
  984.    Use BitMap 3:Colour 1:BitMapInput
  985.    Locate 0,1:NPrint "            CONGRATULATIONS!            "
  986.    Locate 0,3:NPrint " You have entered the high score table! "
  987.    Locate 0,4:NPrint "         Please enter your name:        "
  988.    Locate 10,6:name$=Edit$(20)
  989.    For s=9 To 0 Step -1
  990.     If score=>highpoints(s) Then pos=s
  991.    Next s
  992.    For s=9 To pos Step -1
  993.     If s>0
  994.       highname$(s)=highname$(s-1)
  995.       highpoints(s)=highpoints(s-1)
  996.     EndIf
  997.    Next s
  998.    highname$(pos)=name$
  999.    highpoints(pos)=score
  1000.      If name$="I WANT TO CHEAT" AND cheat=0
  1001.         Sound 11,8
  1002.         Locate 0,31:NPrint "        CHEAT MODE ACTIVATED!!!        "
  1003.         cheat=1
  1004.         Repeat
  1005.         Until Joyb(1)=1 OR RawStatus($40)
  1006.      EndIf
  1007. QAMIGA
  1008. suc=OpenFile(0,"Data/highscores")
  1009.    Fields 0,highname$(0)
  1010.    Fields 0,highname$(1)
  1011.    Fields 0,highname$(2)
  1012.    Fields 0,highname$(3)
  1013.    Fields 0,highname$(4)
  1014.    Fields 0,highname$(5)
  1015.    Fields 0,highname$(6)
  1016.    Fields 0,highname$(7)
  1017.    Fields 0,highname$(8)
  1018.    Fields 0,highname$(9)
  1019.    Fields 0,highpoints(0)
  1020.    Fields 0,highpoints(1)
  1021.    Fields 0,highpoints(2)
  1022.    Fields 0,highpoints(3)
  1023.    Fields 0,highpoints(4)
  1024.    Fields 0,highpoints(5)
  1025.    Fields 0,highpoints(6)
  1026.    Fields 0,highpoints(7)
  1027.    Fields 0,highpoints(8)
  1028.    Fields 0,highpoints(9)
  1029.    Put 0,0
  1030.    CloseFile 0
  1031. EndIf
  1032. DisplayBitMap 2,5:DisplayPalette 2,0
  1033. QAMIGA
  1034. Use BitMap 3:Cls
  1035. Goto begin
  1036.  
  1037. .savegame
  1038.  
  1039. QAMIGA
  1040. levela=level+1
  1041. If level=51 Then levela=1:complete=1
  1042. suc=OpenFile(sav,"Data/savegame"+Str$(sav))
  1043.     Fields sav,levela
  1044.     Fields sav,health
  1045.     Fields sav,lives
  1046.     Fields sav,score
  1047.     Fields sav,cheat
  1048.     Fields sav,complete
  1049.     Put sav,0
  1050.     CloseFile sav
  1051.     done=1
  1052.     VWait 50
  1053. BLITZ
  1054.  
  1055. Return
  1056.  
  1057. .loadgame
  1058.  
  1059. QAMIGA
  1060. suc=OpenFile(sav,"Data/savegame"+Str$(sav))
  1061.     VWait
  1062.     PlayMed
  1063.     Fields sav,levela
  1064.     Fields sav,health
  1065.     Fields sav,lives
  1066.     Fields sav,score
  1067.     Fields sav,cheat
  1068.     Fields sav,complete
  1069.     Get sav,0
  1070.     CloseFile sav
  1071.     done=1
  1072.     VWait 50
  1073. BLITZ
  1074.  
  1075. Return
  1076.  
  1077. .finish
  1078.  
  1079. CreateDisplay 2:DisplayBitMap 2,3:DisplayPalette 2,0
  1080. BitMapOutput 3:Use BitMap 3:Colour 1:QAMIGA:Cls:BLITZ
  1081. Format "######0"
  1082. If complete=0 AND cheat=0
  1083.    Locate 0,0 :NPrint "            CONGRATULATIONS!            "
  1084.    Locate 0,2 :NPrint "        You have completed Blobz.       "
  1085.    Locate 0,3 :NPrint "   Your final score is:       ",score
  1086.    Locate 0,5 :NPrint "              CHEAT MODE!               "
  1087.    Locate 0,7 :NPrint "     On the high score table, type:     "
  1088.    Locate 0,8 :NPrint "             I WANT TO CHEAT            "
  1089.    Locate 0,9 :NPrint "     exactly as it's written above.     "
  1090.    Locate 0,11:NPrint "  Then use the following keys in-game:  "
  1091.    Locate 0,13:NPrint "             S - Skip Level             "
  1092.    Locate 0,14:NPrint "             L - Extra Life             "
  1093.    Locate 0,15:NPrint "            H - Extra Health            "
  1094.    Locate 0,16:NPrint "            K - Kill yourself           "
  1095.    Locate 0,18:NPrint "  BEWARE: If you put the cheat mode on  "
  1096.    Locate 0,29:NPrint "    you will NOT enter the high score   "
  1097.    Locate 0,20:NPrint "    table, regardless of your score.    "
  1098.    Locate 0,31:NPrint "               PRESS FIRE               "
  1099.    Repeat:Until Joyb(1)=1 OR RawStatus($40)
  1100.    QAMIGA:Cls:BLITZ
  1101.    Locate 0,14:NPrint "      Now your game will be saved.      "
  1102.    Locate 0,15:NPrint "  Load it back in to start again with a "
  1103.    Locate 0,16:NPrint "              difference...             "
  1104.    Format "0":Gosub savegame
  1105.    Locate 0,31:NPrint "               PRESS FIRE               "
  1106.    Repeat:Until Joyb(1)=1 OR RawStatus($40)
  1107.    QAMIGA:Cls:BLITZ
  1108.    Goto gameover
  1109. EndIf
  1110.  
  1111. If complete=>0 AND cheat=1
  1112.    Locate 0,13:NPrint "   Your final score is:       ",score
  1113.    Locate 0,14:NPrint "              CHEATER!!!!               "
  1114.    If complete=0
  1115.       Locate 0,15:NPrint "      Now your game will be saved.      "
  1116.       Locate 0,16:NPrint "  Load it back in to start again with a "
  1117.       Locate 0,17:NPrint "              difference...             "
  1118.       Format "0":Gosub savegame
  1119.    EndIf
  1120.    Locate 0,31:NPrint "               PRESS FIRE               "
  1121.    Repeat:Until Joyb(1)=1 OR RawStatus($40)
  1122.    QAMIGA:Cls:BLITZ
  1123.    Goto gameover
  1124. EndIf
  1125.  
  1126. If complete=1 AND cheat=0
  1127.    Locate 0,13:NPrint "           CONGRATULATIONS!!            "
  1128.    Locate 0,14:NPrint "   Your final score is:       ",score
  1129.    Locate 0,16:NPrint "   How the hell did you manage that!?!  "
  1130.    Locate 0,17:NPrint "      You truly are a Blobz master!     "
  1131.    Locate 0,31:NPrint "               PRESS FIRE               "
  1132.    Repeat:Until Joyb(1)=1 OR RawStatus($40)
  1133.    QAMIGA:Cls:BLITZ
  1134.    Goto gameover
  1135. EndIf
  1136.  
  1137. .cleanup
  1138.  
  1139. AMIGA
  1140.  
  1141. StopMed
  1142. Free MedModule 0
  1143.  
  1144. For n=0 To 101
  1145.     Free Shape n
  1146. Next n
  1147.  
  1148. For n=0 To 3
  1149.     Free BitMap n
  1150. Next n
  1151.  
  1152. For n=0 To 2
  1153.     Free CopList n
  1154. Next n
  1155.  
  1156. For n=0 To 10
  1157.     Free Sound n
  1158. Next n
  1159.  
  1160. Free Palette 0
  1161.  
  1162. End
  1163.